import { defineStore } from 'pinia';
import piniaPersistConfig from '@/stores/helper/persist';

export const useUserStore = defineStore({
  id: 'user',
  state: () => {
    return {
      token: null,
      userInfo: null
    };
  },
  getters: {},
  actions: {
    setToken(token) {
      this.token = token;
    },
    setUserInfo(userInfo) {
      this.userInfo = userInfo;
    },
  },
  persist: piniaPersistConfig('user')
});
